package yxy.cherry.battle.module.record.stream;

import yxy.cherry.battle.Fighter;
import yxy.cherry.battle.module.affix.Buff;

import java.util.ArrayList;

public class RecordStream_01_附加效果 extends RecordStream {

	private Fighter target;
	private ArrayList<String> buffList = new ArrayList<>();
	private ArrayList<String> buffSeqList = new ArrayList<>();

	public RecordStream_01_附加效果(Fighter target) {
		this.target = target;
	}

	public void addBuff(Buff buff) {
		buffList.add(buff.getBuffCode());
		buffSeqList.add(buff.getBuffCodeSeq());
	}

	@Override
	protected void _record() {
		sb().append(1);
		sb().append("|");
		sb().append(target.getFighterPosition().code());
		sb().append("|");
		sb().append(buffList.toString());
		sb().append("|");
		sb().append(buffSeqList.toString());
		sb().append(";");
	}

}
